################################################################################################################
# REPLICATION FILES FOR                                                                                        #
# "Conspiracy beliefs and perceptions of electoral integrity: Cross-national evidence from 29 countries"       #
# PUBLIC OPINION QUARTERLY										       #
#													       #
# AUTHOR: Christian Schnaudt (corresponding author)                                                            #
# ADDRESS: School of Social Sciences, University of Mannheim, 68131 Mannheim, Germany                          # 
# E-MAIL: schnaudt@uni-mannheim.de 								               #
# ORCID: 0000-0002-2062-7770										       #   
#													       #
# VERSION DATE: 2023-10-06							                               #   
################################################################################################################


# PREAMBLE
THIS REPOSITORY CONTAINS ALL REPLICATION FILES (DATA AND ANALYSIS SCRIPTS) TO REPLICATE THE RESULTS AND
FINDINGS PRESENTED IN THE ARTICLE "Conspiracy beliefs and perceptions of electoral integrity: Cross-
national evidence from 29 countries" (PUBLISHED IN PUBLIC OPINION QUARTERLY).


################################################################################################################


# LIST OF REPLICATION FILES

# 1 DATA FILES

# 1a "data_merged_clean.dta"
This Stata file contains merged data from (a) the European Social Survey (ESS) round 10, (b) the Varieties
of Democracy (V-DEM) Project, (c) the World Bank, and (d) National Elections Across Democracy and Autocracy
(NELDA) Project. This data file should be used in combination with the analysis script "variables_prep.do"
to generate all relevant variables used in the final analysis. 
PLEASE NOTE: This step is not required for replicating the analysis; instead you can directly use the data 
file "data_analysis.dta" (see below).

# 1b "data_analysis.dta"
This Stata file is the ready-to-go data set for replicating all statistical analyses and findings shown
in the article (it was created based on the Stata files "data_merged_clean.dta" and "variables_prep.do").
This data file should be used in combination with the R analysis scripts "analysis_models.R", 
"analysis_tables.R", and "analysis_figures.R" (in that order!).

Note on data versions: 
ESS10 edition 3.1 (published 05.07.2023) and ESS10SC edition 3.0 (published 05.07.2023); V-Dem v13 (March 
2023); World Bank (https://databank.worldbank.org/indicator/NY.GDP.PCAP.CD/1ff4a498/Popular-Indicators); 
NELDA v6 (published 23.07.2021).


# 2 ANALYSIS SCRIPTS

# 2a "variables_prep.do"
This Stata do-file generates all variables used in the final statistical analysis. In addition, it creates
Table S2 as shown in the Supplementary Material.

# 2b "analysis_models.R"
This R script reads the Stata data file "data_analysis.dta" and runs all statistical models referenced in 
the article. IMPORTANT: Run this file first, i.e., before running the files "analysis_tables.R" and 
"analysis_figures.R"! 

# 2c "analysis_tables.R"
This R script creates and saves tables S4-S16 as shown in the Supplementary Material. IMPORTANT: Make sure
to run this script using the R workspace previously created with "analysis_models.R"!

# 2d "analysis_figures.R"
This R script creates and saves figures 1-4 as shown in the article as well as figures S1-S2 as shown in 
the Supplementary Material. IMPORTANT: Make sure to run this script using the R workspace previously created
with "analysis_models.R"!


################################################################################################################